package com.lc.soft.entity;

public class PageBean {

    private int page = 1;
    private int pageSize = 10;
    private int start = 0;

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = Math.max(page, 1);
        if (pageSize > 0) {
            this.start = (this.page - 1) * pageSize;
        }
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize < 1 ? 10 : pageSize;
        if (page > 0) {
            this.start = (page - 1) * this.pageSize;
        }
    }

    public int getStart() {
        return start;
    }

    public void setStart(int start) {
        this.start = start;
    }
}
